/*
 * Copyright (c) 2010 Curtis Boyden.  All rights reserved. 
 * This software was developed by Curtis Boyden and is provided under the terms 
 * of the GNU Lesser General Public License, Version 2.1. You may not use 
 * this file except in compliance with the license. If you need a copy of the license, 
 * please go to http://www.gnu.org/licenses/lgpl-2.1.txt. The Original Code is ejMud
 * (Ewerp Java MUD).  The Initial Developer is Curtis Boyden.
 *
 * Software distributed under the GNU Lesser Public License is distributed on an "AS IS" 
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or  implied. Please refer to 
 * the license for the specific language governing your rights and limitations.
 */

package com.ewerp.mud.core.session;

/**
 * An {@link ISessionManager} manages the {@link ISession}s for the ejMud. An
 * {@link ISession} is a single entry point into the ejMud for a given message
 * format over a given transport.
 * 
 * @author cboyden
 * 
 */
public interface ISessionManager {

    /**
     * Add an {@link ISession} to be managed by this {@link ISessionManager}.
     * 
     * @param session
     *            An {@link ISession} to be managed by this
     *            {@link ISessionManager} <br />
     *            <ul>
     *            <li>{@link ISession} : A valid session implementing
     *            {@link ISession}</li>
     *            <li>null : A null value will result in an
     *            {@link IllegalArgumentException}</li>
     *            </ul>
     * @throws IllegalArgumentException
     *             Must be thrown if {@link ISession} is null
     */
    public void addSession(ISession session) throws IllegalArgumentException;

    /**
     * Stop an {@link ISession} from being managed by this
     * {@link ISessionManager}.
     * 
     * @param session
     *            An {@link ISession} to be removed from this
     *            {@link ISessionManager} <br />
     *            <ul>
     *            <li>{@link ISession} : A valid session implementing
     *            {@link ISession}</li>
     *            <li>null : A null value will result in an
     *            {@link IllegalArgumentException}</li>
     *            </ul>
     * @throws IllegalArgumentException
     *             Must be thrown if {@link ISession} is null
     */
    public void removeSession(ISession session) throws IllegalArgumentException;
}
